package com.thread.thread;

/**
 * @author wangyingjie
 * @date
 * @remark
 */
public class MyThread_3 extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(getName()+"===> "+i);
            if (i == 20) {
                Thread.yield();
            }
        }
    }

    public static void main(String[] args) {//主线程
        MyThread_3 thread1 = new MyThread_3();
        thread1.setPriority(Thread.MAX_PRIORITY);
        thread1.start();
        MyThread_3 thread2 = new MyThread_3();
        thread2.setPriority(Thread.MIN_PRIORITY);
        thread2.start();
    }
}
